<%@ page language="java"  pageEncoding="utf-8"%>
<%@ page import="com.ejoysoft.wlanyz.business.Ac,com.ejoysoft.wlanyz.system.SignalPara,java.util.ArrayList,com.ejoysoft.common.Constants,com.ejoysoft.common.exception.NoRightException" %>
<%@page import="java.util.Vector"%>
<%@ include file="../include/jsp/head.jsp"%>
<%
if(!globa.userSession.hasRight("50040"))
      throw new NoRightException("用户不具备操作该功能模块的权限，请与系统管理员联系！");
      String strId = ParamUtil.getString(request,"strId","");
      SignalPara pObj=new SignalPara(globa);
 	  SignalPara pObj0 = pObj.show(" where strid = '" + strId + "'");
 	  String paraname = "";
 	  String explain = "";
 	  String paraname1= "射线条数";
      String paraname2="渲染方格数";
      String paraname3="非可视区域最大区间";
      String paraname4="信号衰减阈值";
 	  
 	  if(pObj0.getParaName().equals("rays")){paraname ="射线条数";explain = "请输入180的整数倍！";}
 	  if(pObj0.getParaName().equals("cells")){paraname ="渲染方格数";explain = "请输入某个整数的平方！";}
 	  if(pObj0.getParaName().equals("invisible"))paraname ="非可视区域最大区间";
 	  if(pObj0.getParaName().equals("attenuation")){paraname ="信号衰减阈值";explain="请输入一个0到-1000的数字！";}
 %>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
  <head>
<link href="../css/main.css" rel="stylesheet" type="text/css" />
<script src="../scripts/jsframework.js"></script>
<script src="../scripts/jquery-1.4.1.min.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><style type="text/css">

<!--
body {
	background-color: #f2f8ff;
}
.sel1{ width:160px;}
.STYLE1 {color: #FF0000}
a:link{ line-height:25px;height:25px; color:#2074b8;text-decoration:none}
a:hover{ line-height:25px;height:25px; color:#333333;text-decoration:none}
-->
</style>
<script src="../include/js/chkFrm.js"></script>
<script language="javascript">
 function chkFrm() {
  
    if(<%=paraname==paraname1%>)
    {
           if(trim(frm.ParaValue.value)=="") {
            alert("请输入射线条数！！！")
            frm.ParaValue.focus();
            return false;
            }
            if(!(trim(frm.ParaValue.value)%180==0)) {
            alert("请输入有效的射线条数！！！")
            frm.ParaValue.focus();
            return false;
            }
            if(trim(frm.ParaValue.value)>2147483647) {
            alert("数值过大，请输入有效的射线条数！！！")
            frm.ParaValue.focus();
            return false;
            }
            if(Math.floor(trim(frm.ParaValue.value))!=trim(frm.ParaValue.value)) {
            alert("请输入整数！！！")
            frm.ParaValue.focus();
            return false;
            }
            
    }
    
     if(<%=paraname==paraname2%>)
    {
           if(trim(frm.ParaValue.value)=="") {
            alert("请输入渲染方格数！！！")
            frm.ParaValue.focus();
            return false;
            }
            if(Math.floor(Math.sqrt(frm.ParaValue.value))*Math.floor(Math.sqrt(frm.ParaValue.value))!=frm.ParaValue.value) {
            alert("请输入有效渲染方格数！！！")
            frm.ParaValue.focus();
            return false;
            }
            if(trim(frm.ParaValue.value)>2147483647) {
            alert("数值过大，请输入有效的渲染方格数！！！")
            frm.ParaValue.focus();
            return false;
            }
            if(Math.floor(trim(frm.ParaValue.value))!=trim(frm.ParaValue.value)) {
            alert("请输入整数！！！")
            frm.ParaValue.focus();
            return false;
            }
           
    }
    
     if(<%=paraname==paraname3%>)
    {
           if(trim(frm.ParaValue.value)=="") {
            alert("请输入非可视区域的最大区间！！！")
            frm.ParaValue.focus();
            return false;
            }
            if(trim(frm.ParaValue.value)>2147483647) {
            alert("数值过大，请输入有效的非可视区域的最大区间！！！")
            frm.ParaValue.focus();
            return false;
            }
            if(Math.floor(trim(frm.ParaValue.value))!=trim(frm.ParaValue.value)) {
            alert("请输入整数！！！")
            frm.ParaValue.focus();
            return false;
            }
           
    }
    
     if(<%=paraname==paraname4%>)
    {
           if(trim(frm.ParaValue.value)=="") {
            alert("请输入信号衰减阈值！！！")
            frm.ParaValue.focus();
            return false;
            }
            if(trim(frm.ParaValue.value)>0) {
            alert("数值过大，请输入有效的信号衰减阈值！！！")
            frm.ParaValue.focus();
            return false;
            }
            if(isNaN(trim(frm.ParaValue.value))) {
            alert("请输入一个0到-1000的数字！！！")
            frm.ParaValue.focus();
            return false;
            }
              if(trim(frm.ParaValue.value)<-1000){
            alert("数值过小，请输入有效的信号衰减阈值！！！")
            frm.ParaValue.focus();
            return false;
            }   
    }
    	frm.submit();
    }
</script>
</head>

<body>
<form name="frm" METHOD=POST ACTION="signalpara_act.jsp" enctype="multipart/form-data">
<input type="hidden" name="<%=Constants.ACTION_TYPE%>" value="<%=Constants.UPDATE_STR%>">
<table width="97%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30"><img src="../images/ri_list.jpg" width="14" height="14" align="absbottom" />&nbsp;您现在所在的位置：<font color="#0e7cc9">参数管理</font> &gt; 参数修改 </td>
  </tr>
</table>
<br>
<table width="97%" border="0" align="center" cellpadding="0" cellspacing="0">

  <tr>
    <td width="6%" class="listtit1"  style="border-left:1px solid #32a4ea;">&nbsp;参数修改</td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF" class="listd" style="border-left:1px solid #dddddd;border-right:1px solid #dddddd;"><table width="702" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td height="20" colspan="4">&nbsp;</td>
      </tr>
      <tr>
        <td width="128" align="right">&nbsp;<input name="strId" type="hidden" value="<%=strId %>" /></td>
        <td width="200"  align="right" class="tdwz"> <%=paraname %>:</td>
        <td width="262"><input id="ParaValue" name="ParaValue" type="text" value="<%if(!pObj0.getParaName().equals("attenuation")){%><%=(int)pObj0.getParaValue() %><%} %><%else{ %><%=pObj0.getParaValue() %><%} %>" class="ipt" /></td>
        <td width="262"><font color="red"><%=explain %></font></td>
        <td width="212">&nbsp;<input id="strId" name="strId" type="hidden" value="<%=pObj0.getStrId() %>" /><input id="ParaName"name="ParaName" type="hidden" value="<%=pObj0.getParaName() %>"/></td>
      </tr>
      
      <tr>
        <td align="right">&nbsp;<input id ="yincang" name ="yincang" type ="text" style="display:none"></td>
        <td height="50" align="left">&nbsp;&nbsp;</td>
        <td height="50" colspan="2" align="left"><input name="B1" type="button"  value="确  定" onclick="chkFrm()"  class="ipt1" style="cursor:hand"/>
          &nbsp;<input name="B12" type="reset" value="取 消" class="ipt2" style="cursor:hand"/>
          &nbsp;<input name="B12" type="button"  onclick="window.location.href='signalpara_list.jsp';" value="返 回" class="ipt2" style="cursor:hand"/></td>
        </tr>
    </table>
      <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p></td>
  </tr>
</table>
</html>

